package edu.sctu.zhu;

import edu.sctu.zhu.listener.StartupListener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;

/**
 * Created by apple on 9/14/15.
 */
@SpringBootApplication
@EnableAutoConfiguration
public class Application extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder){
        return builder.sources(Application.class);

    }
    /**
     * 配置spring boot运行的主函数
     * @param args
     */
    public static void main(String[] args) {
        SpringApplication springApplication =new SpringApplication(Application.class);
        springApplication.addListeners(new StartupListener());
        springApplication.run(args);

    }
}
